<template>
  <!-- 实名认证 -->
  <view class="root">
    <view class="wrapper">
      <view class="wrapper-item">
        <view class="label-item">业主姓名:</view>
        <view class="content-item">{{ form.ownerName || "" }}</view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">身份证号:</view>
        <view class="content-item">{{ encryptIDCard(form.idNumber) || "" }}</view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">联系电话:</view>
        <view class="content-item">{{ form.phoneNumber || "" }}</view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">开锁时间:</view>
        <view class="content-item">{{ form.unlockTime ? moment(form.unlockTime).format('YYYY/MM/DD HH:mm') : "" }}
        </view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">上报时间:</view>
        <view class="content-item">{{ form.reportTime || "" }}</view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">地图选点:</view>
        <view class="content-item">{{ form.mapPoint || "" }}</view>
      </view>
      <view class="wrapper-item">
        <view class="label-item">详细地址:</view>
        <view class="content-item">{{ form.detailedAddress || "" }}</view>
      </view>
    </view>
  </view>
</template>

<script>
  import {
    getUnlockRecordById
  } from "@/api/api.js";
  import {
    getOptionsParams,
    pvwImage,
    encryptIDCard
  } from "@/utils/util.js";
  import moment from "../../utils/moment";

  export default {
    data() {
      return {
        baseImgUrl: this.$baseImgUrl,
        baseURL: this.$baseURL,
        imgPrefix: uni.getStorageSync("imgPrefix"),
        form: {},
        errorType: ["none"],
        routerParams: {}
      };
    },
    onLoad(options) {
      this.routerParams = getOptionsParams(options, 'params')
      this.getDetail();
    },
    methods: {
      encryptIDCard,
      pvwImage,
      moment,
      getDetail() {
        getUnlockRecordById({
          id: this.routerParams.id
        }).then((res) => {
          if (res.code == 200) {
            this.form = res.result;
          }
        });
      },
    },
  };
</script>

<style>
  page {
    background-color: #f3f3f3 !important;
    height: 100%;
  }
</style>
<style lang="scss" scoped>
  .root {
    flex: 1;
    background-color: #f3f3f3;

    .wrapper {
      width: 718rpx;
      background: #FFFFFF;
      border-radius: 16rpx 16rpx 16rpx 16rpx;
      margin: 0 auto;
      padding: 0 27rpx;
      margin-top: 10rpx;

      .wrapper-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1rpx solid #F3F0F0;
        padding-top: 48rpx;
        padding-bottom: 21rpx;

        &:last-child {
          border: 0;
        }

        .label-item {
          font-size: 28rpx;
          color: #7F7E83;
          flex-shrink: 0;
          margin-right: 30rpx;
        }

        .content-item {
          font-weight: bold;
          font-size: 28rpx;
          color: #333333;
        }
      }

      .photo-class {
        width: 90rpx;
        height: 56rpx;
      }
    }
  }
</style>